<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

/*Route::get('/', function () {
    return view('welcome');
});*/
Route::get('/','StaticPagesController@home')->name('home');
Route::get('/help', 'StaticPagesController@help')->name('help');
Route::get('/about', 'StaticPagesController@about')->name('about');

Route::get('/signup','UserController@create')->name('signup');

Route::resource('users','UserController');

Route::get('login','SessionController@create')->name('login');
Route::post('login','SessionController@store')->name('login');
Route::delete('logout','SessionController@destroy')->name('logout');

//注册邮件验证
Route::get('signup/confirm/{token}','UserController@confirmEmail')->name('confirm_email');

//忘记密码
//忘记密码，重置填写邮箱表单页面
Route::get('password/reset','Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
//发送重置密码邮件方法
Route::post('password/email','Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
//在邮箱打开重置密码页面
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
//提交重置后的密码
Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update');

//微博相关
Route::resource('statuses','StatusController',['only'=>['store','destroy']]);

//关注的人列表
Route::get('/users/{user}/followings','UserController@followings')->name('users.followings');
//粉丝列表
Route::get('/users/{user}/followers','UserController@followers')->name('users.followers');
//关注
Route::post('/users/followers/{user}','FollowersController@follow')->name('followers.follow');
//取关
Route::delete('/users/followers/{user}','FollowersController@unfollow')->name('followers.unfollow');